package br.ita.supertrunfo.server.core;

import java.io.IOException;
import java.rmi.AccessException;
import java.rmi.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

import org.prevayler.Prevayler;
import org.prevayler.PrevaylerFactory;

import br.ita.supertrunfo.server.domain.BaralhoIP;

public class MainRN {

	public final static String DATA_FOLDER = "data";
	
	public static void main(String[] args) {
		
		try {
			Prevayler prevayler = PrevaylerFactory.createPrevayler(new BaralhoIP(), DATA_FOLDER);
			
			ServidorRN servidor = new ServidorRN(prevayler);
			LocateRegistry.getRegistry().bind("trunfo",servidor);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}